package com.zone.domain.task.service;

import com.zone.domain.task.model.entity.TaskEntity;
import com.zone.domain.task.repository.ITaskRepository;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author: zongzi
 * @description: TODO
 * @date: 2025/2/24
 */
@Slf4j
@Service
public class TaskServiceImpl implements ITaskService {
    @Autowired
    private ITaskRepository taskRepository;

    @Override
    public List<TaskEntity> queryNoSendTaskList() {
        return taskRepository.queryNoSendTaskList();
    }

    @Override
    public void sendMessage(TaskEntity taskEntity) {
        taskRepository.sendMessage(taskEntity);
    }

    @Override
    public void updateCompleteByUserIdAndMessageId(String userId, String messageId) {
        taskRepository.updateCompleteByUserIdAndMessageId(userId, messageId);
    }

    @Override
    public void updateFailByUserIdAndMessageId(String userId, String messageId) {
        taskRepository.updateFailByUserIdAndMessageId(userId, messageId);
    }
}
